package com.Action;
import com.Services.RecruitmentService;
import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.ServletActionContext;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import javax.servlet.http.HttpServletRequest;


/**
 * Created by Administrator on 2017/3/18
 * 这是用于删除公告的.
 */
public class deleteGonggao extends ActionSupport {
    @Override
    public String execute() throws Exception {
        HttpServletRequest request= ServletActionContext.getRequest();
        request.setCharacterEncoding("utf-8");
        ApplicationContext ac=new ClassPathXmlApplicationContext("applicationContext.xml");
        RecruitmentService rs=ac.getBean(RecruitmentService.class);
        String id=request.getParameter("id");
        rs.deleteGonggao(Integer.parseInt(id));
        return super.execute();
    }
}
